<?php
	defined( '_JEXEC' ) or die( 'Restricted access' );
	jimport('joomla.application.component.view');
	jimport('joomla.file.path');
	
	class ActinMapViewEventCreation extends JView
	{
		var $_option = null;
		
		function display($tpl = null)
		{
			$modelEvent=&$this->getModel();
			
			$categories=$modelEvent->getEventCategories();
			
			$this->addCSS();
			$this->addJavascripts();
			
			$this->assignRef('option', JRequest::getCmd('option'));
			$this->assignRef('categories', $categories);
			
			parent::display($tpl);
		}
		private function addCSS(){
			$option=JRequest::getCmd('option');
			
			$document=&JFactory::getDocument();
			$document->addStyleSheet('components/'.$option.'/css/sunny/jquery-ui-1.8.11.custom.css');
			$document->addStyleSheet('components/'.$option.'/css/actinmap.css');
		}
		private function addJavascripts(){
			$option=JRequest::getCmd('option');
			
			$document=&JFactory::getDocument();
			$document->addScript('http://maps.google.com/maps/api/js?sensor=false');
			$document->addScript('components/'.$option.'/js/jquery-1.5.1.min.js');
			$document->addScript('components/'.$option.'/js/jquery-ui-1.8.11.custom.min.js');
			$document->addScript('components/'.$option.'/js/eventsMap.js');
			$document->addScript('components/'.$option.'/js/eventCreation.js');
		}
		
		public function paintMapPanel(){
			include JPath::find($this->_path['template'],'mapPanel.php');
		}
		
		public function paintFormCreationPanel(){
			include JPath::find($this->_path['template'],'formCreationPanel.php');
		}
		
	}
?>